from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from datetime import datetime

# 初始化数据库
db = SQLAlchemy()

# 初始化登录管理器
login_manager = LoginManager()

@login_manager.user_loader
def load_user(user_id):
    """用户加载器"""
    from models import User
    return User.query.get(int(user_id))
